import java.io.PrintStream;

/**
 * <p></p>
 * User: albert
 * Date: Aug 30, 2007
 * Time: 1:14:25 PM
 */
public class JursesToolkit {
    private static JursesToolkit instance = new JursesToolkit();
    private static final byte ESCAPE = 27;
    private JursesToolkit() {
    }

    /**
     * get instance
     *
     * @return JursesToolkit
     * */
    public JursesToolkit getInstance() {
        return instance;
    }

    /**
     * print ESCAPE key
     * */
    public void printESC() {
        out.print(ESCAPE);
    }

    /**
     * init
     * */
    public void init() {
        printESC();
        out.print('c');
    }

    /**
     * addString print string at current cursor position
     * */
    public void addString(int left,int top,String str) {
        printESC();
        out.print('[');
        out.print(Integer.toString(left));
        out.print(';');
        out.print(Integer.toString(top));
    }


    private PrintStream out = System.out;
}
